package com.hdf.etdemo.viewframe.adapter;

import com.hdf.etdemo.viewframe.ViewPageFragmentActivity;
import com.hdf.etdemo.viewframe.fragment.*;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class FragmentAdapter extends FragmentPagerAdapter{
	public final static int TAB_COUNT = 4;
	public FragmentAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int id) {
		switch (id) {
		case ViewPageFragmentActivity.TAB_page1:
			Page1 page1 = new Page1();
			return page1;
		case ViewPageFragmentActivity.TAB_page2:
			Page2 page2 = new Page2();
			return page2;
		case ViewPageFragmentActivity.TAB_page3:
			Page3 page3 = new Page3();
			return page3;
		case ViewPageFragmentActivity.TAB_page4:
			Page4 page4 = new Page4();
			return page4;
		}
		return null;
	}

	@Override
	public int getCount() {
		return TAB_COUNT;
	}
}
